import { Graph } from "@antv/x6";

import CommitNode from './CommitNode';
import FinishNode from './FinishNode';
import UserNode from './UserNode';
import ServiceNode from './ServiceNode';
import GatewayNode from './GatewayNode';
import SequenceFlow from './SequenceFlow';

enum BpmnElements{
  CommitNode = 'CommitNode',
  FinishNode = 'FinishNode',
  UserNode = 'UserNode',
  ServiceNode = 'ServiceNode',
  GatewayNode = 'GatewayNode',
  SequenceFlow = 'SequenceFlow',
}

const BpmnShapeNames:any = {
  Process: '流程定义',
  CommitNode: '流程启动',
  FinishNode: '流程结束',
  UserNode: '用户审批',
  ServiceNode: '服务调用',
  GatewayNode: '网关',
  SequenceFlow: '流转路径',
}

const registerElements=()=>{
  Graph.registerNode('CommitNode',CommitNode);
  Graph.registerNode('FinishNode',FinishNode);
  Graph.registerNode('UserNode',UserNode);
  Graph.registerNode('ServiceNode',ServiceNode);
  Graph.registerNode('GatewayNode',GatewayNode);
  Graph.registerEdge('SequenceFlow',SequenceFlow);
}

export {
  CommitNode,
  FinishNode,
  UserNode,
  ServiceNode,
  GatewayNode,
  SequenceFlow,
  BpmnElements,
  BpmnShapeNames,
  registerElements
};